<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript">
	function selectPagesize(field) {
		window.location = document.getElementById("firstPage").href
				+ "&pagesize=" + field.value;
	}
</script>
<pg:pager url="${param.url}" items="${total}"
	maxPageItems="10" maxIndexPages="5"
	export="currentPageNumber=pageNumber">
	<table width="100%" border="0" cellspacing="1" cellpadding="1">
	 <pg:param name="maxPageItems" value="10"/>
		<tr>
			<td width="50%" align="left" vAlign="middle" noWrap>
				<div align="left">
					 共有<strong>${total}</strong> 条记录， 当前第<strong> ${currentPageNumber }</strong> 页 <pg:last> 共 <strong>${pageNumber}</strong> 页   </pg:last>
					
				</div>
			</td>
			<td width="50%" align="right" vAlign="middle" noWrap>
			<div align="right">
			 <c:forEach
					items="${param.params}" var="p">
					<pg:param name="${p}" />
			</c:forEach> <pg:first>
					<a id="firstPage" href="${pageUrl}">首页</a>
				</pg:first> <pg:prev>
					<a href="${pageUrl}">前页</a>
				</pg:prev> <pg:pages>
					<c:choose>
						<c:when test="${currentPageNumber eq pageNumber}">
							<font color="red">${pageNumber }</font>
						</c:when>
						<c:otherwise>
							<a href="${pageUrl }">${pageNumber}</a>
						</c:otherwise>
					</c:choose>
				</pg:pages> <pg:next>
					<a href="${pageUrl}">下页</a>
				</pg:next> 
				<pg:last>
					<a href="${pageUrl}">尾页</a>
				
				<select name="pagesize" onchange="selectPagesize(this)">
					<c:forEach begin="1" end="${pageNumber }" step="1" var="i">
						<option value="${i}" <c:if test="${i eq pagesize }">selected</c:if> >${i}</option>
					</c:forEach>
			  </select>
			</pg:last> 
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
			</td>
		</tr>
	</table>
</pg:pager>

